const childProcess = require("child_process");
const path = require("path");

// 配置每个应用的路径
const filePath = {
  base: path.join(__dirname, "../app/base"),
  main: path.join(__dirname, "../apps/main"),
  system: path.join(__dirname, "../apps/system"),
};
// cd 子应用的目录 npm start 启动项目
function runChild() {
  Object.values(filePath).forEach((item) => {
    childProcess.spawn(`cd ${item} && npm run build`, {
      stdio: "inherit",
      shell: true,
    });
  });
}
runChild();
